﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy2_1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            double radius = Convert.ToDouble(textBox1.Text);
            // 计算圆的面积
            double area = Math.PI * radius * radius;
            // 计算圆的周长
            double circumference = 2 * Math.PI * radius;
            // 将面积和周长显示在只读文本框中
            textBox2.Text = area.ToString();
            textBox3.Text = circumference.ToString();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";
            textBox2.Text = "";
            textBox3.Text = "";
        }
    }
}
